import React ,{useState,useEffect}from 'react';
import {View,Text,TouchableOpacity,StyleSheet,ScrollView,Image} from 'react-native';
import '../../global'

const RecruitDetail=({route})=>{
    let tmp;
    switch(route.params.school){
        case '上海交通大学':
            tmp = 'https://img2.baidu.com/it/u=412112083,2140326944&fm=253&fmt=auto&app=138&f=JPEG?w=499&h=156';
            break;
        case '上海大学':
            tmp = 'https://img2.baidu.com/it/u=2781609282,655295577&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=292';
            break;
        case '同济大学':
            tmp = 'https://img2.baidu.com/it/u=2318683706,4043349030&fm=253&fmt=auto&app=138&f=JPEG?w=257&h=104';
            break;
        case '复旦大学':
            tmp = 'https://img1.baidu.com/it/u=4110626287,3852071110&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=450';
            break;
        case '中国政法大学':
            tmp = 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.zhimg.com%2Fv2-940c2ab7e9e86c7264a61fb4ae315ac0_180x120.jpg&refer=http%3A%2F%2Fpic1.zhimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1655604404&t=0692195a4a20b4a995ea020c7576e203';
            break;
        case '北京交通大学':
            tmp = 'https://img2.baidu.com/it/u=1516823216,860496151&fm=253&fmt=auto&app=120&f=JPEG?w=1080&h=400';
            break;
        case '北京大学':
            tmp = 'https://img0.baidu.com/it/u=3368513071,3732826175&fm=253&fmt=auto&app=138&f=JPG?w=500&h=145';
            break;
        case '北京工业大学':
            tmp = 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.mpa8.com%2Fuploads%2Fallimg%2F210611%2F1-2106111111260-L.jpg&refer=http%3A%2F%2Fwww.mpa8.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1655623162&t=86a88ed0ce77e978404ea51d0b23fc1a';
            break;
        case '北京理工大学':
            tmp = 'https://img1.baidu.com/it/u=2117885767,969287811&fm=253&fmt=auto&app=138&f=JPEG?w=595&h=196';
            break;
        case '清华大学':
            tmp = 'https://img2.baidu.com/it/u=304256388,2758375805&fm=253&fmt=auto&app=138&f=JPEG?w=640&h=434';
            break;
        case '中国科学技术大学':
            tmp = 'https://img2.baidu.com/it/u=1222367029,3061247613&fm=253&fmt=auto&app=138&f=JPEG?w=900&h=383';
            break;
        case '南开大学':
            tmp = 'https://img2.baidu.com/it/u=2944212109,123222632&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=199';
            break;
        case '天津大学':
            tmp = 'https://img1.baidu.com/it/u=1521025504,3211279098&fm=253&fmt=auto&app=138&f=PNG?w=683&h=230';
            break;
        case '河北工业大学':
            tmp = 'https://img2.baidu.com/it/u=3351078612,3693787612&fm=253&fmt=auto&app=138&f=JPEG?w=1583&h=500';
            break;
        case '河北医科大学':
            tmp = 'https://img1.baidu.com/it/u=150246597,2406559110&fm=253&fmt=auto&app=138&f=JPEG?w=300&h=78';
            break;
        case '河北师范大学':
            tmp = 'https://img1.baidu.com/it/u=3933391477,1439957427&fm=253&fmt=auto&app=138&f=JPEG?w=648&h=486';
            break;
        case '河北科技大学':
            tmp = 'https://img1.baidu.com/it/u=3933391477,1439957427&fm=253&fmt=auto&app=138&f=JPEG?w=648&h=486';
            break;
        case '大连海事大学':
            tmp = 'https://img0.baidu.com/it/u=1279691792,1666447541&fm=253&fmt=auto&app=120&f=JPEG?w=436&h=306';
            break;
        case '辽宁大学':
            tmp = 'https://img0.baidu.com/it/u=2151085523,471797629&fm=253&fmt=auto&app=138&f=JPEG?w=1250&h=500';
            break;
        case '哈尔滨工业大学':
            tmp = 'https://img2.baidu.com/it/u=2118390282,4071246883&fm=253&fmt=auto&app=138&f=JPEG?w=701&h=188';
            break;
        case '吉林大学':
            tmp = 'https://img0.baidu.com/it/u=3220902469,1201283937&fm=253&fmt=auto&app=138&f=JPEG?w=858&h=303';
             break;
        default:
            tmp = 'https://img1.baidu.com/it/u=523251696,3621061816&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500';
            break;
    }

    return(
        <View style={{position:'relative'}}>
            <Image source={{uri:tmp}}  style={styles.img} resizeMode='stretch'/>
            <View style={styles.view}>
                <Text style={styles.title}>{route.params.school}2022年硕士研究生招生简章</Text>
                <Text style={styles.txt}>&emsp;&emsp;{route.params.content}</Text>
            </View>
            
        </View>
    )
}


const styles=StyleSheet.create({
    view:{
        width:'90%',
        marginLeft:changeW(40),
        backgroundColor:'white',
        borderRadius:changeW(20),
        paddingBottom:changeH(60),
        position:'absolute',
        top:changeH(200),
        paddingLeft:changeW(20),
        paddingRight:changeW(20)
    },
    img:{
        width:'100%',
        height:changeH(400),
        position:'absolute',
        top:0
    },
    txt:{
        fontSize:changeW(25)
    },
    title:{
        fontSize:changeW(30),
        fontWeight:'bold',
        textAlign:'center',
        marginTop:changeH(30),
        marginBottom:changeH(50)
    }
})
export default RecruitDetail;